package com.xian.param;

public class Test5 {
    public static void main(String[] args) {
        //需求：比较两个数组是否一样 true false---个数、值、顺序一样
        int [] arr1 = {10,20,30};
        int [] arr2 = {10,20,30,40};

        System.out.println( compare(arr1,arr2));

    }

    public static boolean compare(int [] arr1,int [] arr2){
        if(arr1.length==arr2.length){
            for (int i = 0; i < arr1.length; i++) {
                if(arr1[i] != arr2[i]){
                    return false;
                }
            }
            return true;
        }else {
            return false;
        }
    }
}
